package com.idealighter.game.games.wknh.struct;

public enum WknhDifficulty {
  /**
   * HARDEST 最难，用户收益(-50%,-30%).
   */
  HARDEST(-2, "最难", 14285, 20000),
  /**
   * DIFFICULT 困难，用户收益(-30%,-20%).
   */
  DIFFICULT(-1, "困难", 12500, 14285),
  /**
   * 普通，用户收益(-20%,0%).
   */
  NORMAL(0, "普通", 10000, 12500),
  /**
   * 简单，用户收益(0%,10%).
   */
  EASY(1, "简单", 9091, 10000),
  /**
   * 轻松，用户收益(10%,30%).
   */
  EASIEST(2, "轻松", 7692, 9091);



  // 难度
  public final int difficulty;
  // 名称
  public final String name;
  public final int lower;
  public final int upper;

  /**
   * 构造函数.
   * 
   * @param difficulty 难度.
   * @param name 名称.
   * @param lower .
   * @param upper .
   */
  private WknhDifficulty(int difficulty, String name, int lower, int upper) {
    this.difficulty = difficulty;
    this.name = name;
    this.lower = lower;
    this.upper = upper;
  }

  /**
   * 获取难度.
   * 
   * @param difficulty 难度值.
   * @return 难度》
   */
  public static WknhDifficulty get(int difficulty) {
    for (WknhDifficulty d : values()) {
      if (d.difficulty == difficulty) {
        return d;
      }
    }

    return null;
  }

}
